<!doctype html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<title>Image preview example</title>
<script type="text/javascript">

</script>
</head>

<body onload="loadImageFile();">
<input type="file" />
</body>
</html>

<!--
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>轿运联盟</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<style type="text/css">

</style>
 </head>
 
<body>
<input type="file" id="file">

<div id="preImg">

</div>
</body>
<script>

var fe = document.getElementById("file");
var img = document.getElementById("preImg");
fe.onchange = function() {
	var reader = new FileReader();
	var _file = this.files[0];
	//console.log(reader); 
	//  建议去输出下这3个东西 仔细看看就明白了
	//console.log(this.files);
	//console.log(_file); 
	reader.readAsDataURL(_file);  //这个是很重要的一步  讲读取到的文件编码成DataURL 否则不能用
	console.log(reader);
	reader.onload = function() {
		img.setAttribute('src',this.result);
	};
}
		
</script>
</html>
-->